Carbon


CloneWindow

Header: MacWindows.h Carbon status: Supported

Increments the number of references to a window.

OSStatus CloneWindow (
    WindowRef window
);
window

A pointer to the window whose reference count is to be incremented.

function result

A result code.

DISCUSSION

You should call CloneWindow if you are using a window and wish to ensure that it is not disposed while you are using it. With the Mac OS 8.5 Window Manager, all windows are created with a reference count (owner count) of one. The function CloneWindow increments the number of references to a window, and the earlier function DisposeWindow decrements the number of references. When the reference count reaches zero, DisposeWindow disposes of the window.

SPECIAL CONSIDERATIONS

To maintain an accurate reference count, you must follow every call to the CloneWindow function with a matching call to the DisposeWindow function when your application is ready to release its reference to the window.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)